home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / Balloons.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  9.6 KB  |  272 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Balloons.p
  3.  
  4.      Contains:    Balloon Help Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Balloons;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __BALLOONS__}
  30. {$SETC __BALLOONS__ := 1}
  31.  
  32. {$I+}
  33. {$SETC BalloonsIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    QuickdrawText.p                                                }
  47.  
  48. {$IFC UNDEFINED __MENUS__}
  49. {$I Menus.p}
  50. {$ENDC}
  51. {    Memory.p                                                    }
  52.  
  53. {$IFC UNDEFINED __TEXTEDIT__}
  54. {$I TextEdit.p}
  55. {$ENDC}
  56.  
  57. {$IFC UNDEFINED __ERRORS__}
  58. {$I Errors.p}
  59. {$ENDC}
  60.  
  61. {$PUSH}
  62. {$ALIGN MAC68K}
  63. {$LibExport+}
  64.  
  65. CONST
  66.     hmBalloonHelpVersion        = $0002;                        { The real version of the Help Manager }
  67.     kHMHelpMenuID                = -16490;                        { Resource ID and menu ID of help menu }
  68.     kHMAboutHelpItem            = 1;                            { help menu item number of About Balloon Help… }
  69.     kHMShowBalloonsItem            = 3;                            { help menu item number of Show/Hide Balloons }
  70.     kHMHelpID                    = -5696;                        { ID of various Help Mgr package resources (in Pack14 range) }
  71.     kBalloonWDEFID                = 126;                            { Resource ID of the WDEF proc used in standard balloons }
  72. { Dialog item template type constant }
  73.     helpItem                    = 1;                            { key value in DITL template that corresponds to the help item }
  74. { Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  75.     hmDefaultOptions            = 0;                            { default options for help manager resources }
  76.     hmUseSubID                    = 1;                            { treat resID's in resources as subID's of driver base ID (for Desk Accessories) }
  77.     hmAbsoluteCoords            = 2;                            { ignore window port origin and treat rectangles as absolute coords (local to window) }
  78.  
  79.     hmSaveBitsNoWindow            = 4;                            { don't create a window, just blast bits on screen. No update event is generated }
  80.     hmSaveBitsWindow            = 8;                            { create a window, but restore bits behind window when window goes away & generate update event }
  81.     hmMatchInTitle                = 16;                            { for hwin resources, match string anywhere in window title string }
  82. { Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources }
  83.     kHMStringItem                = 1;                            { pstring used in resource }
  84.     kHMPictItem                    = 2;                            { 'PICT' ResID used in resource }
  85.     kHMStringResItem            = 3;                            { 'STR#' ResID & index used in resource }
  86.     kHMTEResItem                = 6;                            { Styled Text Edit ResID used in resource ('TEXT' & 'styl') }
  87.     kHMSTRResItem                = 7;                            { 'STR ' ResID used in resource }
  88.     kHMSkipItem                    = 256;                            { don't display a balloon }
  89.     kHMCompareItem                = 512;                            { Compare pstring in menu item w/ PString in resource item ('hmnu' only) }
  90.     kHMNamedResourceItem        = 1024;                            { Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) }
  91.     kHMTrackCntlItem            = 2048;                            { Reserved }
  92. { Constants for hmmHelpType's when filling out HMMessageRecord }
  93.     khmmString                    = 1;                            { help message contains a PString }
  94.     khmmPict                    = 2;                            { help message contains a resource ID to a 'PICT' resource }
  95.     khmmStringRes                = 3;                            { help message contains a res ID & index to a 'STR#' resource }
  96.     khmmTEHandle                = 4;                            { help message contains a Text Edit handle }
  97.     khmmPictHandle                = 5;                            { help message contains a Picture handle }
  98.     khmmTERes                    = 6;                            { help message contains a res ID to 'TEXT' & 'styl' resources }
  99.     khmmSTRRes                    = 7;                            { help message contains a res ID to a 'STR ' resource }
  100.     kHMEnabledItem                = 0;                            { item is enabled, but not checked or control value = 0 }
  101.  
  102. { ResTypes for Styled TE Handles in Resources }
  103.     kHMTETextResType            = 'TEXT';                        { Resource Type of text data for styled TE record w/o style info }
  104.     kHMTEStyleResType            = 'styl';
  105.  
  106.     kHMDisabledItem                = 1;                            { item is disabled, grayed in menus or disabled in dialogs }
  107.     kHMCheckedItem                = 2;                            { item is enabled, and checked or control value = 1 }
  108.     kHMOtherItem                = 3;                            { item is enabled, and control value > 1 }
  109. { Method parameters to pass to HMShowBalloon }
  110.     kHMRegularWindow            = 0;                            { Create a regular window floating above all windows }
  111.     kHMSaveBitsNoWindow            = 1;                            { Just save the bits and draw (for MDEF calls) }
  112.     kHMSaveBitsWindow            = 2;                            { Regular window, save bits behind, AND generate update event }
  113.  
  114. { Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages }
  115.     kHMMenuResType                = 'hmnu';                        { ResType of help resource for supporting menus }
  116.     kHMDialogResType            = 'hdlg';                        { ResType of help resource for supporting dialogs }
  117.     kHMWindListResType            = 'hwin';                        { ResType of help resource for supporting windows }
  118.     kHMRectListResType            = 'hrct';                        { ResType of help resource for rectangles in windows }
  119.     kHMOverrideResType            = 'hovr';                        { ResType of help resource for overriding system balloons }
  120.     kHMFinderApplResType        = 'hfdr';
  121.  
  122.  
  123. TYPE
  124.     HMStringResType = RECORD
  125.         hmmResID:                INTEGER;
  126.         hmmIndex:                INTEGER;
  127.     END;
  128.  
  129.     HMMessageRecord = RECORD
  130.         hmmHelpType:            SInt16;
  131.         CASE INTEGER OF
  132.         0: (
  133.             hmmString:                    Str255;
  134.            );
  135.         1: (
  136.             hmmPict:                    SInt16;
  137.            );
  138.         2: (
  139.             hmmTEHandle:                TEHandle;
  140.            );
  141.         3: (
  142.             hmmStringRes:                HMStringResType;
  143.            );
  144.         4: (
  145.             hmmPictRes:                    SInt16;
  146.            );
  147.         5: (
  148.             hmmPictHandle:                PicHandle;
  149.            );
  150.         6: (
  151.             hmmTERes:                    SInt16;
  152.            );
  153.         7: (
  154.             hmmSTRRes:                    SInt16;
  155.            );
  156.     END;
  157.  
  158.     HMMessageRecPtr = ^HMMessageRecord;
  159.  
  160.     TipFunctionProcPtr = ProcPtr;  { FUNCTION TipFunction(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: INTEGER): OSErr; }
  161.     TipFunctionUPP = UniversalProcPtr;
  162.  
  163. CONST
  164.     uppTipFunctionProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  165.  
  166. FUNCTION NewTipFunctionProc(userRoutine: TipFunctionProcPtr): TipFunctionUPP;
  167.     {$IFC NOT GENERATINGCFM }
  168.     INLINE $2E9F;
  169.     {$ENDC}
  170.  
  171. FUNCTION CallTipFunctionProc(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: INTEGER; userRoutine: TipFunctionUPP): OSErr;
  172.     {$IFC NOT GENERATINGCFM}
  173.     INLINE $205F, $4E90;
  174.     {$ENDC}
  175. {  Public Interfaces  }
  176.  
  177. FUNCTION HMGetHelpMenuHandle(VAR mh: MenuRef): OSErr;
  178.     {$IFC NOT GENERATINGCFM}
  179.     INLINE $303C, $0200, $A830;
  180.     {$ENDC}
  181. FUNCTION HMShowBalloon({CONST}VAR aHelpMsg: HMMessageRecord; tip: Point; alternateRect: RectPtr; tipProc: TipFunctionUPP; theProc: SInt16; balloonVariant: SInt16; method: SInt16): OSErr;
  182.     {$IFC NOT GENERATINGCFM}
  183.     INLINE $303C, $0B01, $A830;
  184.     {$ENDC}
  185. FUNCTION HMRemoveBalloon: OSErr;
  186.     {$IFC NOT GENERATINGCFM}
  187.     INLINE $303C, $0002, $A830;
  188.     {$ENDC}
  189. FUNCTION HMGetBalloons: BOOLEAN;
  190.     {$IFC NOT GENERATINGCFM}
  191.     INLINE $303C, $0003, $A830;
  192.     {$ENDC}
  193. FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr;
  194.     {$IFC NOT GENERATINGCFM}
  195.     INLINE $303C, $0104, $A830;
  196.     {$ENDC}
  197. FUNCTION HMShowMenuBalloon(itemNum: SInt16; itemMenuID: SInt16; itemFlags: SInt32; itemReserved: SInt32; tip: Point; alternateRect: RectPtr; tipProc: TipFunctionUPP; theProc: SInt16; balloonVariant: SInt16): OSErr;
  198.     {$IFC NOT GENERATINGCFM}
  199.     INLINE $303C, $0E05, $A830;
  200.     {$ENDC}
  201. FUNCTION HMGetIndHelpMsg(whichType: ResType; whichResID: SInt16; whichMsg: SInt16; whichState: SInt16; VAR options: UInt32; VAR tip: Point; VAR altRect: Rect; VAR theProc: SInt16; VAR balloonVariant: SInt16; VAR aHelpMsg: HMMessageRecord; VAR count: SInt16): OSErr;
  202.     {$IFC NOT GENERATINGCFM}
  203.     INLINE $303C, $1306, $A830;
  204.     {$ENDC}
  205. FUNCTION HMIsBalloon: BOOLEAN;
  206.     {$IFC NOT GENERATINGCFM}
  207.     INLINE $303C, $0007, $A830;
  208.     {$ENDC}
  209. FUNCTION HMSetFont(font: SInt16): OSErr;
  210.     {$IFC NOT GENERATINGCFM}
  211.     INLINE $303C, $0108, $A830;
  212.     {$ENDC}
  213. FUNCTION HMSetFontSize(fontSize: UInt16): OSErr;
  214.     {$IFC NOT GENERATINGCFM}
  215.     INLINE $303C, $0109, $A830;
  216.     {$ENDC}
  217. FUNCTION HMGetFont(VAR font: SInt16): OSErr;
  218.     {$IFC NOT GENERATINGCFM}
  219.     INLINE $303C, $020A, $A830;
  220.     {$ENDC}
  221. FUNCTION HMGetFontSize(VAR fontSize: UInt16): OSErr;
  222.     {$IFC NOT GENERATINGCFM}
  223.     INLINE $303C, $020B, $A830;
  224.     {$ENDC}
  225. FUNCTION HMSetDialogResID(resID: SInt16): OSErr;
  226.     {$IFC NOT GENERATINGCFM}
  227.     INLINE $303C, $010C, $A830;
  228.     {$ENDC}
  229. FUNCTION HMSetMenuResID(menuID: SInt16; resID: SInt16): OSErr;
  230.     {$IFC NOT GENERATINGCFM}
  231.     INLINE $303C, $020D, $A830;
  232.     {$ENDC}
  233. FUNCTION HMBalloonRect({CONST}VAR aHelpMsg: HMMessageRecord; VAR coolRect: Rect): OSErr;
  234.     {$IFC NOT GENERATINGCFM}
  235.     INLINE $303C, $040E, $A830;
  236.     {$ENDC}
  237. FUNCTION HMBalloonPict({CONST}VAR aHelpMsg: HMMessageRecord; VAR coolPict: PicHandle): OSErr;
  238.     {$IFC NOT GENERATINGCFM}
  239.     INLINE $303C, $040F, $A830;
  240.     {$ENDC}
  241. FUNCTION HMScanTemplateItems(whichID: SInt16; whichResFile: SInt16; whichType: ResType): OSErr;
  242.     {$IFC NOT GENERATINGCFM}
  243.     INLINE $303C, $0410, $A830;
  244.     {$ENDC}
  245. FUNCTION HMExtractHelpMsg(whichType: ResType; whichResID: SInt16; whichMsg: SInt16; whichState: SInt16; VAR aHelpMsg: HMMessageRecord): OSErr;
  246.     {$IFC NOT GENERATINGCFM}
  247.     INLINE $303C, $0711, $A830;
  248.     {$ENDC}
  249. FUNCTION HMGetDialogResID(VAR resID: SInt16): OSErr;
  250.     {$IFC NOT GENERATINGCFM}
  251.     INLINE $303C, $0213, $A830;
  252.     {$ENDC}
  253. FUNCTION HMGetMenuResID(menuID: SInt16; VAR resID: SInt16): OSErr;
  254.     {$IFC NOT GENERATINGCFM}
  255.     INLINE $303C, $0314, $A830;
  256.     {$ENDC}
  257. FUNCTION HMGetBalloonWindow(VAR window: WindowRef): OSErr;
  258.     {$IFC NOT GENERATINGCFM}
  259.     INLINE $303C, $0215, $A830;
  260.     {$ENDC}
  261.  
  262. {$ALIGN RESET}
  263. {$POP}
  264.  
  265. {$SETC UsingIncludes := BalloonsIncludes}
  266.  
  267. {$ENDC} {__BALLOONS__}
  268.  
  269. {$IFC NOT UsingIncludes}
  270.  END.
  271. {$ENDC}
  272.